package com.yanqu.road.server.manger.activity.auto.send;

import com.yanqu.road.entity.activity.ActivityInfo;
import com.yanqu.road.entity.activity.UnionActivityConditionData;
import com.yanqu.road.entity.activity.UserActivityConditionData;
import com.yanqu.road.entity.servercenter.ServerInfo;
import com.yanqu.road.logic.bussiness.player.UserActivityBussiness;
import com.yanqu.road.pb.activity.AutoSendRewardProto;
import com.yanqu.road.server.manger.ServerListMgr;
import com.yanqu.road.server.manger.player.GamePlayerMgr;
import com.yanqu.road.server.protocol.Protocol;
import com.yanqu.road.utils.ConfigHelper;

import java.util.List;
import java.util.Map;

public class EnterNameActivityAutoSend extends BaseAutoSendActivity {

    public EnterNameActivityAutoSend(ActivityInfo activityInfo) {
        super(activityInfo);
    }

    @Override
    public void sendLocalUserRankReward() {

    }

    @Override
    public void sendLocalUnionRankReward() {

    }

    @Override
    protected boolean updateConditionData(UserActivityConditionData data) {
        return UserActivityBussiness.updateUserActivityConditionData(data);
    }

    @Override
    public void sendConditionReward() {

    }

    @Override
    public List<UserActivityConditionData> getNeedSendUserActivityConditionData() {
        return null;
    }

    @Override
    public Map<String, UnionActivityConditionData> getUnionActivityConditionData(int conditionType) {
        return null;
    }

    @Override
    public Map<Long, UserActivityConditionData> getUserActivityRankConditionData(int activityId, int conditionType) {
        return getUserNormalActivityRankConditionData(activityId, conditionType);
    }

    @Override
    public void noticeCrossUserRank() {
        AutoSendRewardProto.NoticeChannelUserRankMsg.Builder msg = AutoSendRewardProto.NoticeChannelUserRankMsg.newBuilder();
        msg.setActivityId(activityInfo.getActivityId());
        msg.setActivityType(activityInfo.getType());
        msg.setChildType(activityInfo.getChildType());
        long serverId = ConfigHelper.getLong("serverId");
        ServerInfo serverInfo = ServerListMgr.getServerInfo(serverId);
        msg.setChannelId(serverInfo.getChannelId());
        msg.setServerId(serverId);
        GamePlayerMgr.sendChannelPacket(Protocol.N_CROSS_AUTO_SEND_USER_RANK_LIST, msg, 0);
    }
}
